from selenium import webdriver
from selenium.webdriver import ActionChains
import time


browser = webdriver.Chrome('C:\\Users\\Administrator\\www\\chromedriver.exe')
time.sleep(3)
# 获取网址
browser.get("http://127.0.0.1:8080/klogin")

# 获取并输入
username = browser.find_element_by_xpath('//*[@id="app"]/div/input[1]').send_keys('11')
password = browser.find_element_by_xpath('//*[@id="app"]/div/input[2]').send_keys('11')
button = browser.find_element_by_xpath('//*[@id="app"]/div/div/div[3]')
sub = browser.find_element_by_xpath('//*[@id="app"]/div/button')


action = ActionChains(browser)
action.drag_and_drop_by_offset(button,262,0).perform()
sub.click()
time.sleep(3)

browser.close()


